package main

import (
	"Gin_test/pkg/logging"
	"github.com/robfig/cron"

	"Gin_test/models"
)

func main() {
	logging.Info(("Starting..."))

	c := cron.New()
	c.AddFunc("* * * * * *", func() {
		logging.Info(("Run models.CleanAllTag..."))
		models.CleanAllTag()
	})
	c.AddFunc("* * * * * *", func() {
		logging.Info(("Run models.CleanAllArticle..."))
		models.CleanAllArticle()
	})

	c.Start()

	//t1 := time.NewTimer(time.Second * 10)

	for {
		a := true
		logging.Info(a)
		//select {
		//case <-t1.C:
		//	t1.Reset(time.Second * 10)
		//}
	}
}
